package com.github.kotvertolet.youtubejextractor.models.newModels;

import com.github.kotvertolet.youtubejextractor.models.youtube.playerResponse.Thumbnail;
import com.google.gson.annotations.SerializedName;
import ohos.utils.Parcel;
import ohos.utils.Sequenceable;

import java.io.Serializable;
import java.util.List;

public class VideoDetails implements Sequenceable, Serializable {

    @SerializedName("isOwnerViewing")
    private boolean isIsOwnerViewing;

    @SerializedName("thumbnail")
    private Thumbnail thumbnail;

    @SerializedName("")
    private boolean isLiveContent;

    @SerializedName("keywords")
    private List<String> keywords;

    @SerializedName("author")
    private String author;

    @SerializedName("lengthSeconds")
    private String lengthSeconds;

    @SerializedName("videoId")
    private String videoId;

    @SerializedName("shortDescription")
    private String shortDescription;

    @SerializedName("isPrivate")
    private boolean isPrivate;

    @SerializedName("title")
    private String title;

    @SerializedName("isCrawlable")
    private boolean isIsCrawlable;

    @SerializedName("averageRating")
    private double averageRating;

    @SerializedName("isUnpluggedCorpus")
    private boolean isUnpluggedCorpus;

    @SerializedName("allowRatings")
    private boolean isAllowRatings;

    @SerializedName("viewCount")
    private String viewCount;

    @SerializedName("channelId")
    private String channelId;



    public static final Sequenceable.Producer<VideoDetails> CREATOR = new Producer<VideoDetails>() {
        @Override
        public VideoDetails createFromParcel(Parcel parcel) {
            // Initialize an instance first, then do customized unmarshlling.
            VideoDetails videoDetails = new VideoDetails();
            videoDetails.unmarshalling(parcel);
            return videoDetails;
        }
    };
    
    
    @Override
    public boolean marshalling(Parcel parcel) {
        parcel.writeBoolean(this.isIsOwnerViewing);
        parcel.writeSequenceable(this.thumbnail);
        parcel.writeBoolean(this.isLiveContent);
        parcel.writeStringList(this.keywords);
        parcel.writeString(this.author);
        parcel.writeString(this.lengthSeconds);
        parcel.writeString(this.videoId);
        parcel.writeString(this.shortDescription);
        parcel.writeBoolean(this.isPrivate);
        parcel.writeString(this.title);
        parcel.writeBoolean(this.isIsCrawlable);
        parcel.writeDouble(this.averageRating);
        parcel.writeBoolean(this.isUnpluggedCorpus);
        parcel.writeBoolean(this.isAllowRatings);
        parcel.writeString(this.viewCount);
        parcel.writeString(this.channelId);

        return true;
    }

    @Override
    public boolean unmarshalling(Parcel parcel) {
        this.isIsOwnerViewing=parcel.readBoolean();
        parcel.readSequenceable(this.thumbnail);
        this.isLiveContent=parcel.readBoolean();
        this.keywords = parcel.readStringList();
        this.author=parcel.readString();
        this.lengthSeconds=parcel.readString();
        this.videoId=parcel.readString();
        this.shortDescription=parcel.readString();
        this.isPrivate=parcel.readBoolean();
        this.title=parcel.readString();
        this.isIsCrawlable=parcel.readBoolean();
        this.averageRating=parcel.readDouble();
        this.isUnpluggedCorpus=parcel.readBoolean();
        this.isAllowRatings=parcel.readBoolean();
        this.viewCount=parcel.readString();
        this.channelId=parcel.readString();


        return true;
    }


    @Override
    public String toString() {
        return "VideoDetails{" +
                "isIsOwnerViewing=" + isIsOwnerViewing +
                ", thumbnail=" + thumbnail +
                ", isLiveContent=" + isLiveContent +
                ", keywords=" + keywords +
                ", author='" + author + '\'' +
                ", lengthSeconds='" + lengthSeconds + '\'' +
                ", videoId='" + videoId + '\'' +
                ", shortDescription='" + shortDescription + '\'' +
                ", isPrivate=" + isPrivate +
                ", title='" + title + '\'' +
                ", isIsCrawlable=" + isIsCrawlable +
                ", averageRating=" + averageRating +
                ", isUnpluggedCorpus=" + isUnpluggedCorpus +
                ", isAllowRatings=" + isAllowRatings +
                ", viewCount='" + viewCount + '\'' +
                ", channelId='" + channelId + '\'' +
                '}';
    }

    public boolean isIsOwnerViewing() {
        return isIsOwnerViewing;
    }

    public void setIsOwnerViewing(boolean isOwnerViewing) {
        isIsOwnerViewing = isOwnerViewing;
    }

    public Thumbnail getThumbnail() {
        return thumbnail;
    }

    public void setThumbnail(Thumbnail thumbnail) {
        this.thumbnail = thumbnail;
    }

    public boolean isLiveContent() {
        return isLiveContent;
    }

    public void setLiveContent(boolean liveContent) {
        isLiveContent = liveContent;
    }

    public List<String> getKeywords() {
        return keywords;
    }

    public void setKeywords(List<String> keywords) {
        this.keywords = keywords;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public String getLengthSeconds() {
        return lengthSeconds;
    }

    public void setLengthSeconds(String lengthSeconds) {
        this.lengthSeconds = lengthSeconds;
    }

    public String getVideoId() {
        return videoId;
    }

    public void setVideoId(String videoId) {
        this.videoId = videoId;
    }

    public String getShortDescription() {
        return shortDescription;
    }

    public void setShortDescription(String shortDescription) {
        this.shortDescription = shortDescription;
    }

    public boolean isPrivate() {
        return isPrivate;
    }

    public void setPrivate(boolean aPrivate) {
        isPrivate = aPrivate;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public boolean isIsCrawlable() {
        return isIsCrawlable;
    }

    public void setIsCrawlable(boolean isCrawlable) {
        isIsCrawlable = isCrawlable;
    }

    public double getAverageRating() {
        return averageRating;
    }

    public void setAverageRating(double averageRating) {
        this.averageRating = averageRating;
    }

    public boolean isUnpluggedCorpus() {
        return isUnpluggedCorpus;
    }

    public void setUnpluggedCorpus(boolean unpluggedCorpus) {
        isUnpluggedCorpus = unpluggedCorpus;
    }

    public boolean isAllowRatings() {
        return isAllowRatings;
    }

    public void setAllowRatings(boolean allowRatings) {
        isAllowRatings = allowRatings;
    }

    public String getViewCount() {
        return viewCount;
    }

    public void setViewCount(String viewCount) {
        this.viewCount = viewCount;
    }

    public String getChannelId() {
        return channelId;
    }

    public void setChannelId(String channelId) {
        this.channelId = channelId;
    }
}
